package com.imooc.springboot.dubbo.provider.quickstart;

import com.imooc.springboot.dubbo.ServiceApi;

//@Component
//@Service(interfaceClass = ServiceApi.class)
public class QuickstartServiceImpl implements ServiceApi {
    @Override
    public String sendMessage(String message) {

        return "quickstart-provider-massage = "+message;
    }

    /**
     * 背景: 订单业务分布式事务改造
     * 业务:
     * 1. 判断传入的座位是否存在
     * 2. 查询过往订单,判断座位是否已售
     * 3. 新增订单
     * <p>
     * 逻辑:
     * 1. 新增一条订单
     * 2. 判断作为是否存在 & 是否已售
     * 3. 任意一条为假,则修改订单状态为无效状态
     *
     * @param seats
     */
    @Override
    public boolean isTrueSeats(String seats) {
        return false;
    }

    @Override
    public boolean isNotSold(String seats) {
        return false;
    }

    @Override
    public String saveOrder(String fieldId, String seats, String seatsName) {
        return null;
    }
}
